package org.liuyunfeng.web;

import lombok.Getter;
import lombok.Setter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: TanJingyu
 * @create: 2022-05-11 16:31
 **/
@RequestMapping("/result")
@RestController
public class ResultController {

    @GetMapping("/person")
    public Result person() {
        Person person = new Person();
        person.setUsername("谭景玉");
        person.setAge(23);
        return person;
    }

    @GetMapping("/build")
    public Result build() {
        Build build = new Build();
        build.setName("世贸商城");
        build.setAddress("长岭县世贸商城");
        return build;
    }

    @Getter
    @Setter
    public static class Build extends Result {
        private String name;
        private String address;
    }

    @Getter
    @Setter
    public static class Person extends Result {
        private String username;
        private Integer age;
    }
    public static class Result {}
}

    